<template>
	<view class="MLR_3">
		<view class="bg_fff P_2  B_radius_5 color_down MTB_2">
			为了保障账户安全，请填写真实个人信息
		</view>
		
		<view class="bg_fff P_2 B_radius_5 MB_2 flex_rowL">
			<view class="W_34vw">
				姓名
			</view>
			<input class="fontS_14" :disabled="aliBind" type="text" v-model="name" placeholder="请输入姓名" />
		</view>
		<view class="bg_fff P_2 B_radius_5 MB_2 flex_rowL">
			<view class="W_34vw">
				身份证号
			</view>
			<input type="text" v-model='idCard' placeholder="请输入身份证号" />
		</view>
		<view class="bg_fff P_2 B_radius_5 MB_2 flex_rowL">
			<view class="W_34vw">
				银行卡号
			</view>
			<input :disabled="bankBind" type="number" v-model="banknum" placeholder="请输入银行卡号" />
		</view>
		
		<view class="bg_fff P_2 B_radius_5 MB_2 flex_rowL">
			<view class="W_34vw">
				银行预留手机号
			</view>
			<input :disabled="bankBind" type="number" v-model="mobile" placeholder="请输入手机号" />
		</view>
		
		
		<view @click="submit" class="PTB_2 pub_bg color_fff font_weight_bold flex_rowC B_radius_10 MT_4">
			上传审核
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name:'',
				mobile:'',
				idCard:'',
				banknum:'',
				alipay:'',
				user:{},
				info:{},
				aliBind:false,
				bankBind:false
			}
		},
		onLoad() {
			this.getInfo();
			this.getUser();
		},
		methods: {
			getUser(){
				let _this = this;
				this.$req('auth/me',{},function(res){
					
					_this.user = res.data;
					
				})
			},
			// getInfo(){
			// 	let _this = this;
			// 	this.$req('card/isBind',{},function(res){
			// 		if(res.code==1){
			// 			_this.info = res.data;
			// 			if(res.data.alipayIsBind){
			// 				_this.alipay = res.data.alipay.bank_num;
			// 				_this.name = res.data.alipay.realname;
			// 				_this.aliBind = true
			// 			}else{
			// 				_this.aliBind = false
			// 			}
			// 			if(res.data.bankIsBind){
			// 				_this.banknum = res.data.bank.bank_num;
			// 				_this.mobile = res.data.bank.mobile;
			// 				_this.bankBind = true;
			// 			}else{
			// 				_this.bankBind = false;
			// 			}
						
			// 		}else{
			// 			_this.toast(res.msg)
			// 		}
			// 	})
			// },
			submit(){
				let _this = this;
				if(!this.name){
					this.toast('请输入姓名');
				}else if(!this.idCard){
					this.toast('请输入身份证号');
				}else if(!this.banknum){
					this.toast('请输入银行卡号');
				}else if(!this.idCard){
					this.toast('请输入预留手机号');
				}else{
					let params = {
						realname:this.name,
						bank_num:this.banknum,
						idcard:this.idCard,
						bank_mobile:this.mobile,
						// alipay:this.alipay
					};
					this.$req('user/verify',params,function(res){
						if(res.code==1){
							_this.toast(res.msg);
						}else{
							_this.toast(res.msg)
						}
					})
				}
				
			}
		}
	}
</script>

<style>
.line_bom{
	border-bottom: 1rpx solid #F0F0F0;
}
</style>
